package www.webols.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
/**
 * 
 * @author paul
 *
 */
public class StringUtil {
	public static final DateFormat parseFormat=new SimpleDateFormat("EEE MMM d HH:mm:ss Z yyyy",Locale.US);
	public static final DateFormat format= new SimpleDateFormat("yyyy MM HH:mm:ss",Locale.CHINESE);
	
	/**
	 * @deprecated
	 * @param map
	 * @return
	 */
	public static String map2URLParams(Map<String,String> map){
		StringBuffer r=new StringBuffer();
		Iterator<String> keys=map.keySet().iterator();
		
		while(keys.hasNext()){
			String key=(String)keys.next();
			String value=map.get(key);
			if(r.length()>0){
				r.append('&');
			}
			else {
				r.append('?');
			}
			r.append(key).append("=").append(value);
		}
		return r.toString();
	}
	public static void main(String[] args){
		//System.out.println(getWeiboCode("http://dev.19lou.cn/code=agbdadfefwqef"));
	}
}

